import { vehicleCollect } from "@/api/safety/vehicle.js";
const useVehicleStore = defineStore("vehicle", {
  state: () => ({
    totalInfo: {},
    startAndEndStation: [],
  }),
  actions: {
    // 获取车辆统计
    vehicleCollect() {
      return new Promise((resolve, reject) => {
        vehicleCollect()
          .then((res) => {
            this.totalInfo = res.data;
            resolve(res.data);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
  },
  update_startAndEndStation(newVal) {
    return (this.startAndEndStation = newVal);
  },
});

export default useVehicleStore;
